package com.server.common.redis.service;

import com.server.model.all.constant.redis.UserBlackListKeyConstant;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class RedisUserBlackListService {

    @Resource
    private RedisTemplate<String, String> redisTemplate;

    /**
     * 是否是黑名单用户
     * @author LXC
     * @date 2023/2/2 13:34
     */
    public Boolean hasBlackUserId(Long blackUserId){
        return redisTemplate.opsForSet().isMember(UserBlackListKeyConstant.USER_BLACK_LIST,
                String.valueOf(blackUserId));
    }

}
